package org.wanho.txy.ems.mapper;

import org.wanho.txy.ems.entity.User;
import org.wanho.util.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Author：汤小洋
 * Date：2023-05-10 15:32
 * Description：<描述>
 */
public class UserMapper implements RowMapper<User> {
    @Override
    public User mapRow(ResultSet rs) throws SQLException {
        User u = new User();
        u.setId(rs.getInt("id"));
        u.setUsername(rs.getString("username"));
        u.setPassword(rs.getString("password"));
        u.setName(rs.getString("name"));
        u.setAge(rs.getInt("age"));
        u.setStatus(rs.getInt("status"));
        u.setRegistDate(rs.getDate("regist_date"));
        u.setAvatar(rs.getString("avatar"));
        return u;
    }
}
